/*
For general Scribus (>=1.3.2) copyright and licensing information please refer
to the COPYING file provided with the program. Following this notice may exist
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
#include "shadowimpl.h"
#include "scribusdoc.h"
#include "selection.h"

#include <QString>
#include <QMessageBox>

// Initialize members here, if any
ShadowImpl::ShadowImpl() : QObject(0)
{
}

bool ShadowImpl::run(const QString & target, ScribusDoc* doc)
{
	// Do the bulk of your work here
	QMessageBox::information(
			(QWidget*)doc->scMW(),
                        tr("Scribus - DropShadow"),
			tr("The plugin worked!"),
			QMessageBox::Ok|QMessageBox::Default|QMessageBox::Escape,
			QMessageBox::NoButton);
	return true;

        int opacity=opacity/100;
        int attenuation=5;
        int n=10;
        int decal=attenuation/n;
        bool StypeV = TRUE;
        currDoc = doc;
        if (currDoc->m_Selection->count() == 1)
        {
        Item1 = currDoc->m_Selection->itemAt(0);
        QMessageBox::information(
                        (QWidget*)doc->scMW(),
                        tr("Scribus - DropShadow"),
                        tr("1 object selected"),
                        QMessageBox::Ok|QMessageBox::Default|QMessageBox::Escape,
                        QMessageBox::NoButton);
        for (int i=0;i<n;i++)
        {
            //duplicate_object

            if (i>0)
            {
                attenuation=attenuation+1;
                decal=decal+1;
                opacity=opacity+1;
                n=n+1;
                //moveObject(decal+(decal/i),decal+(decal/i))
            //(width,height)=getSize()
            //sizeObject(width-(((decal+(decal/i))*2)),height-(((decal+(decal/i))*2)))
            }
            else
            {
            //moveObject(dx+attenuation,dy+attenuation)
            //setFillColor(color)
            }
            if (StypeV==TRUE)
            {
            //setFillTransparency(opacity/n)
            }
            else
            {
            //setFillShade(opacity*(i*100/n))
            //setLineColor('None')
            //li.append(getSelectedObject())
            }
          }
         for (int i=0;i<n;i++)
         {
            //selectObject(i)
            //groupObjects()
            //moveSelectionToBack()
            //setUnit(docUnit)
            //self.quit()
            //else:
            //messageBox('Select an object',ICON_CRITICAL)
         }
        }
}
